import { RECORD_STATUS } from '@/enum/common';
import { STUDY_MATCH_CITY, STUDY_MATCH_TARGET } from '@/enum/study-match';
import { GENDER, REQUIREMENT } from '@/enum/user';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';

/**
 * 用户匹配需求表
 */
@Entity('study_match_need')
export class StudyMatchNeed extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '用户匹配需求id，主键，自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'user_id',
    comment: '提交匹配需求的用户id',
  })
  userId: number;

  @Column({
    type: 'int',
    name: 'requirement',
    comment: '是否放宽偏好',
    default: REQUIREMENT.NOT_RELAX,
  })
  requirement: REQUIREMENT;

  @Column({
    type: 'varchar',
    name: 'city',
    comment: '对方所在城市',
  })
  city: STUDY_MATCH_CITY;

  @Column({
    type: 'int',
    name: 'sex',
    comment: '对方的性别，1为男，2为女',
  })
  sex: GENDER;

  @Column({
    type: 'varchar',
    name: 'target',
    comment: '希望对方的目',
  })
  target: STUDY_MATCH_TARGET;

  @Column({
    type: 'varchar',
    name: 'age',
    comment: '对方的年龄区间',
  })
  age: string;

  @Column({
    type: 'varchar',
    name: 'height',
    comment: '对方身高区间',
  })
  height: string;

  @Column({
    type: 'int',
    name: 'status',
    comment: `
    记录状态
    /**
     * 正常显示
     */
    SHOW = 1,
    /**
     * 隐藏
     */
    HIDDEN = 2,
    /**
     * 禁用
     */
    DISABLE = 3,
    `,
    default: RECORD_STATUS.SHOW,
  })
  status: RECORD_STATUS;
}
